<template>
    <div class="templ">
        <lottery-info :list='list' :code='code'></lottery-info>
    </div>
</template>

<script>
    import common from '../../kits/common'
    import lotteryInfo from '../subcomponents/lotteryInfo.vue'
    import {datasTranstact} from '../../kits/datasTransaction'

    export default {
        data(){
            return {
                list: [],
                code:''
            }
        },
        created(){
            this.getList();
        },
        methods: {
            getList() {
                //从api接口获取10条数据
                const url = common.apidomain + "dlt-10.json";
                this.$http.jsonp(url).then((response) => {
                    let datas = datasTranstact(response.body).data;
                    for (var i = 0; i < datas.length; i++) {
                        datas[i].opencode[5] =  datas[i].opencode[5] + "+"
                        datas[i].opencode[6] =  datas[i].opencode[6] + "+"
                    }
                    this.list = datas;
                    this.code = response.body.code;
                })
            }
        },
        components:{
            lotteryInfo
        }
    }
</script>

<style scoped>

</style>